package com.mxl.dao.cashorder.impl;

import java.util.List;

import org.hibernate.criterion.Restrictions;

import com.mxl.dao.cashorder.model.PurchaseOrder;
import com.mxl.datebase.orm.hibernate.BaseDaoSupport;

public class PurchaseOrderDaoImpl extends BaseDaoSupport<PurchaseOrder, Long> {
	public boolean getCardPwdUse(String cardPwd) {
		List<PurchaseOrder> pList = this.find(Restrictions.eq("cardPwd",
				cardPwd), Restrictions.eq("state", 1));
		return pList != null && !pList.isEmpty();
	}

	public boolean getCardNoUse(String cardNo) {
		List<PurchaseOrder> pList = this.find(Restrictions
				.eq("cardNo", cardNo), Restrictions.eq("state", 1));
		return pList != null && !pList.isEmpty();
	}
}
